varying vec3 L, texCoord0;
uniform sampler2D normalMap;

void main()
{
	vec3 Ntex = texture2D(normalMap, texCoord0.xy).xyz;
	Ntex.x = (2.0 * Ntex.x) - 1.0;
	Ntex.y = (2.0 * Ntex.y) - 1.0;
	Ntex.z = (2.0 * Ntex.z) - 1.0;
	Ntex = normalize(Ntex);
	
	float c = pow(clamp(dot(L, Ntex), 0.0, 1.0), 2.0);

	gl_FragColor = vec4(c, c, c, 0);
}
